Skip to content

Prevent InsecureRequestWarning#2

Open
stabla wants to merge 2 commits into
zigoo0:masterfrom
stabla:master
Open

Prevent InsecureRequestWarning#2
stabla wants to merge 2 commits into
zigoo0:masterfrom
stabla:master

Conversation

@stabla

@stabla stabla commented Nov 6, 2018

Copy link
Copy Markdown

I wanted to use the script, but a warning appeared and prevented the script to run.

/Library/Python/2.7/lib/python/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

After a quick check on StackOverflow, there's a reason: urllib3 not a part of requests anymore. To disable warnings in requests vendored urllib3, we should import the specific instance of the module.

Adding : from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) in order to prevent it.

stabla and others added 2 commits November 6, 2018 11:56
Disable warnings in requests vendored urllib3, we should import the specific instance of the module

Warning to avoid: /Library/Python/2.7/lib/python/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant